<?php

namespace App\Http\Controllers\home;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

use DB;

class InfoController extends Controller
{
	public function index()
	{
		$list=DB::table('type')->get();
		$config=DB::table('config')->get();
        $user=DB::table('user')->where('id',session()->get('homeuser')->id)->first();
		return view('home.user.info',['config'=>$config,'list'=>$list,'user'=>$user]);
	}
    public function update($id,Request $request)
    {
        $data=$request->only('realname','sex','tel','code');
        $row=DB::table('user')->where('id',$id)->update($data);
        return redirect('/home1/info');
    }
}
